Portable Document Format (PDF) is a file format used to present and exchange documents independent of software, hardware, or operating system. A document converted to or saved as a PDF file generally has the option of being saved as a specific PDF standard. The PDF standard chosen is generally determined by the purpose for which the PDF document was created.
When printing a PDF file, a user may send PDF file data from a printer driver, using a network command (such as LPR) or USB printing. Printer firmware may need to handle all kinds of PDF formats such as PDF 1.2, 1.5, 1.7, as well as other PDF format types. For simplicity, PDF files may be defined as having two types of layouts: non-linearized and linearized.
Non-linearized PDF files may consume less disk space than linearized PDF files, though they may be slower to access because portions of the data required to assemble pages of the document may be scattered throughout the PDF file. Thus, printing a non-linearized PDF file may require the printer to wait until all the file data has been received because the important interpreting information may be located at the end of file.
Linearized PDF files (also called “optimized” or “web optimized” PDF files) may be constructed in a manner that enables them to be read in a Web browser plug-in without waiting for the entire file to download, since they are written to disk in a linear (as in page order) fashion. Linearized PDF files may contain a Linearization Parameter Dictionary in the beginning of the file to specify linearization information such as total file size (LSize), 1st page size (1stPgSize) as well as other linearization information. In the Linearized PDF file, both the interpreting information and the 1st page data are placed in the beginning of the file. Thus, printer firmware may start interpreting and printing the 1st page data of the linearized PDF file without having to wait to receive the whole page data. Thus, linearized PDF files generally are expected to have a better printing performance than non-linearized PDF files.
It is possible to convert a non-linearized PDF file to a linearized PDF file. However, due to the limitation of the printer system memory configuration and printing speed, adding a linearized PDF converter to the printer firmware may be costly and slow down the printer speed. Further, it is necessary to support both formats in printer firmware as in some situations it may be more desirable to print the PDF file as a non-linearized PDF file as oppose to a linearized PDF file.
Therefore, it would be desirable to provide a system and method that overcomes the above. The system and method can interpret and print all PDF formats including non-linearized and linearized PDF formats. The system and method provides a linearized PDF format detection and conversion mechanism in different devices in the pipeline base on different PDF printing flows. The system and method provides an error handling mechanism in stream data storage to improve error handling performance and in interpreting PDF file to avoid printing false error page.